package com.zzq.base.awesome.entity;

import com.auth0.jwt.algorithms.Algorithm;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.zzq.base.awesome.utils.LocalDateTimeDeserializer;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;

import static com.zzq.base.awesome.entity.CommonData.*;


/**
 * @author 赵自强
 */

public class SingleObject {
	/**
	 * 日期格式单例
	 */
	public static SimpleDateFormat dfWithOutGang = new SimpleDateFormat(DATEWITHOUTGANG);
	public static SimpleDateFormat standardDate = new SimpleDateFormat(STANDARDDATE);
	public static SimpleDateFormat dfYMD =new SimpleDateFormat(DATEYMD);
	public static SimpleDateFormat dfHMS=new SimpleDateFormat(DATEHMS);
	public static SimpleDateFormat dataOfFile = new SimpleDateFormat(DATEOFFILE);

	/**
	 * jwt
	 */
	public static Algorithm algorithmHS = Algorithm.HMAC256(JWTSECRET);
	/**
	 * 文件地址
	 */
	public static String filePath = CommonData.LINUXFILEPATH;
	public static String avatarPath = filePath + "avatar/";

	public static ObjectMapper mapGson = new ObjectMapper();

	public static JavaTimeModule timeModule = (JavaTimeModule) new JavaTimeModule().addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer());

}

